home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
gnu
/
dejagnu.lha
/
dejagnu-1.0.1
/
expect
/
configure
< prev
next >
Wrap
Text File
|
1993-04-27
|
24KB
|
930 lines
#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
# --with-PACKAGE unless this script has special code to handle it.
for arg
do
# Handle --exec-prefix with a space before the argument.
if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
# Handle --host with a space before the argument.
elif test x$next_host = xyes; then next_host=
# Handle --prefix with a space before the argument.
elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
# Handle --srcdir with a space before the argument.
elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
else
case $arg in
# For backward compatibility, also recognize exact --exec_prefix.
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
next_exec_prefix=yes ;;
-gas | --gas | --ga | --g) ;;
-host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
-host | --host | --hos | --ho | --h)
next_host=yes ;;
-nfp | --nfp | --nf) ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
no_create=1 ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
next_prefix=yes ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
next_srcdir=yes ;;
-with-* | --with-*)
package=`echo $arg|sed 's/-*with-//'`
# Delete all the valid chars; see if any are left.
if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
echo "configure: $package: invalid package name" >&2; exit 1
fi
eval "with_`echo $package|sed s/-/_/g`=1" ;;
*) ;;
esac
fi
done
trap 'rm -f conftest* core; exit 1' 1 3 15
rm -f conftest*
compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
unique_file=exp_global.h
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
srcdirdefaulted=yes
# Try the directory containing this script, then `..'.
prog=$0
confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
test "X$confdir" = "X$prog" && confdir=.
srcdir=$confdir
if test ! -r $srcdir/$unique_file; then
srcdir=..
fi
fi
if test ! -r $srcdir/$unique_file; then
if test x$srcdirdefaulted = xyes; then
echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
else
echo "configure: Can not find sources in \`${srcdir}'." 1>&2
fi
exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
.|/*|~*) ;;
*) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args. (Sigh.)
if test -z "$INSTALL"; then
echo checking for install
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
case $dir in
/etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
*)
if test -f $dir/install; then
if grep dspmsg $dir/install >/dev/null 2>&1; then
: # AIX
else
INSTALL="$dir/install -c"
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
break
fi
fi
;;
esac
done
IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
if test -z "$RANLIB"; then
echo checking for ranlib
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/ranlib; then
RANLIB="ranlib"
break
fi
done
IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB="@:"
echo checking for pid_t in sys/types.h
echo checking how to run the C preprocessor
if test -z "$CPP"; then
CPP='${CC-cc} -E'
cat > conftest.c <<EOF
#include <stdio.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
:
else
CPP=/lib/cpp
fi
rm -f conftest*
fi
echo '#include <sys/types.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "pid_t" conftest.out >/dev/null 2>&1; then
:
else
DEFS="$DEFS -Dpid_t=int"
SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
\${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
\${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
"
fi
rm -f conftest*
#
# Look for various header files
#
echo checking for string.h
cat > conftest.c <<EOF
#include <string.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
:
else
DEFS="$DEFS -DNO_STRING_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NO_STRING_H\${SEDdB}NO_STRING_H\${SEDdC}1\${SEDdD}
\${SEDuA}NO_STRING_H\${SEDuB}NO_STRING_H\${SEDuC}1\${SEDuD}
\${SEDeA}NO_STRING_H\${SEDeB}NO_STRING_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for stdlib.h
cat > conftest.c <<EOF
#include <stdlib.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
:
else
DEFS="$DEFS -DNOSTDLIB=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NOSTDLIB\${SEDdB}NOSTDLIB\${SEDdC}1\${SEDdD}
\${SEDuA}NOSTDLIB\${SEDuB}NOSTDLIB\${SEDuC}1\${SEDuD}
\${SEDeA}NOSTDLIB\${SEDeB}NOSTDLIB\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sys/stropts.h
cat > conftest.c <<EOF
#include <sys/stropts.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DHAVE_STROPTS_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STROPTS_H\${SEDdB}HAVE_STROPTS_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_STROPTS_H\${SEDuB}HAVE_STROPTS_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_STROPTS_H\${SEDeB}HAVE_STROPTS_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sys/sysconfig.h
cat > conftest.c <<EOF
#include <sys/sysconfig.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DHAVE_SYSCONF_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYSCONF_H\${SEDdB}HAVE_SYSCONF_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SYSCONF_H\${SEDuB}HAVE_SYSCONF_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SYSCONF_H\${SEDeB}HAVE_SYSCONF_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sys/fcntl.h
cat > conftest.c <<EOF
#include <sys/fcntl.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DHAVE_SYS_FCNTL_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYS_FCNTL_H\${SEDdB}HAVE_SYS_FCNTL_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SYS_FCNTL_H\${SEDuB}HAVE_SYS_FCNTL_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SYS_FCNTL_H\${SEDeB}HAVE_SYS_FCNTL_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sys/sysmacros.h
cat > conftest.c <<EOF
#include <sys/sysmacros.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DHAVE_SYSMACROS_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYSMACROS_H\${SEDdB}HAVE_SYSMACROS_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SYSMACROS_H\${SEDuB}HAVE_SYSMACROS_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SYSMACROS_H\${SEDeB}HAVE_SYSMACROS_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for unistd.h
cat > conftest.c <<EOF
#include <unistd.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DHAVE_UNISTD_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#
# Look for various functions
#
echo checking for memcpy
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_memcpy
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char memcpy(); memcpy();
#endif
}
EOF
if eval $compile; then
:
else
DEFS="$DEFS -DNO_MEMCPY=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NO_MEMCPY\${SEDdB}NO_MEMCPY\${SEDdC}1\${SEDdD}
\${SEDuA}NO_MEMCPY\${SEDuB}NO_MEMCPY\${SEDuC}1\${SEDuD}
\${SEDeA}NO_MEMCPY\${SEDeB}NO_MEMCPY\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
echo checking for waitpid
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_waitpid
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char waitpid(); waitpid();
#endif
}
EOF
if eval $compile; then
:
else
DEFS="$DEFS -DNOWAITPID=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NOWAITPID\${SEDdB}NOWAITPID\${SEDdC}1\${SEDdD}
\${SEDuA}NOWAITPID\${SEDuB}NOWAITPID\${SEDuC}1\${SEDuD}
\${SEDeA}NOWAITPID\${SEDeB}NOWAITPID\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
echo checking for wait4
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_wait4
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char wait4(); wait4();
#endif
}
EOF
if eval $compile; then
:
else
DEFS="$DEFS -DHAVE_WAIT4=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_WAIT4\${SEDdB}HAVE_WAIT4\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_WAIT4\${SEDuB}HAVE_WAIT4\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_WAIT4\${SEDeB}HAVE_WAIT4\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
echo checking for sysconf
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_sysconf
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char sysconf(); sysconf();
#endif
}
EOF
if eval $compile; then
DEFS="$DEFS -DHAVE_SYSCONF=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYSCONF\${SEDdB}HAVE_SYSCONF\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SYSCONF\${SEDuB}HAVE_SYSCONF\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SYSCONF\${SEDeB}HAVE_SYSCONF\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
#
# check how signals work
#
# Check for the data type of the function used in signal(). This
# must be before the test for rearming.
echo checking return type of signal handlers
echo '#include <signal.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "(void|sighandler_t).*signal" conftest.out >/dev/null 2>&1; then
retsigtype=void
else
DEFS="$DEFS -DRETSIGTYPE=int"
SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
\${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
\${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
" retsigtype=int
fi
rm -f conftest*
# FIXME: check to see it alarm exists
# Check to see it signals need to be re-armed after use.
echo checking to see if signals need to be re-armed
cat > conftest.c <<EOF
#include <signal.h>
#define RETSIGTYPE $retsigtype
void
sigquit_handler(n)
int n;
{
}
main()
{
if (0 == fork()) {
unlink("core");
signal(SIGQUIT,sigquit_handler);
kill(getpid(),SIGQUIT);
kill(getpid(),SIGQUIT);
} else {
int status;
wait(&status);
exit(unlink("core")==-1?0:1);
}
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
:
else
DEFS="$DEFS -DREARM_SIG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}REARM_SIG\${SEDdB}REARM_SIG\${SEDdC}1\${SEDdD}
\${SEDuA}REARM_SIG\${SEDuB}REARM_SIG\${SEDuC}1\${SEDuD}
\${SEDeA}REARM_SIG\${SEDeB}REARM_SIG\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
# HPUX7 has trouble with the big cat so split it
# Owen Rees <rtor@ansa.co.uk> 29Mar93
SEDDEFS="${SEDDEFS}CONFEOF
cat >> conftest.sed <<CONFEOF
"
#
# Look for various features to determine what kind of pty
# we have. For some weird reason, ac_compile_check would not
# work, but ac_test_program does.
#
echo checking for HP style pty allocation
# following test fails on DECstations and other things that don't grok -c
# but that's ok, since they don't have PTYMs anyway
if test -c /dev/ptym/ptyp0 2>>/dev/null ; then
DEFS="$DEFS -DHAVE_PTYM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PTYM\${SEDdB}HAVE_PTYM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PTYM\${SEDuB}HAVE_PTYM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PTYM\${SEDeB}HAVE_PTYM\${SEDeC}1\${SEDeD}
"
fi
echo checking for HP style pty-trapping
echo '#include <sys/ptyio.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "struct.*request_info" conftest.out >/dev/null 2>&1; then
DEFS="$DEFS -DHAVE_PTYTRAP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PTYTRAP\${SEDdB}HAVE_PTYTRAP\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PTYTRAP\${SEDuB}HAVE_PTYTRAP\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PTYTRAP\${SEDeB}HAVE_PTYTRAP\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for AIX new-style pty allocation
if test -r /dev/ptc -a -r /dev/pts ; then
DEFS="$DEFS -DHAVE_PTC_PTS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PTC_PTS\${SEDdB}HAVE_PTC_PTS\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PTC_PTS\${SEDuB}HAVE_PTC_PTS\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PTC_PTS\${SEDeB}HAVE_PTC_PTS\${SEDeC}1\${SEDeD}
"
fi
echo checking for SGI old-style pty allocation
if test -r /dev/ptc -a ! -r /dev/pts ; then
DEFS="$DEFS -DHAVE_PTC=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PTC\${SEDdB}HAVE_PTC\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PTC\${SEDuB}HAVE_PTC\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PTC\${SEDeB}HAVE_PTC\${SEDeC}1\${SEDeD}
"
fi
echo checking for SVR4 style pty allocation
if test -r /dev/ptmx ; then
DEFS="$DEFS -DHAVE_PTMX=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PTMX\${SEDdB}HAVE_PTMX\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PTMX\${SEDuB}HAVE_PTMX\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PTMX\${SEDeB}HAVE_PTMX\${SEDeC}1\${SEDeD}
"
# aargg. Some systems need libpt.a to use /dev/ptmx
echo checking for libpt.a
echo checking for ptsname
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_ptsname
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char ptsname(); ptsname();
#endif
}
EOF
if eval $compile; then
:
else
LIBS=-lpt
fi
rm -f conftest*
#endif
fi
echo checking for tcgetattr
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_tcgetattr
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char tcgetattr(); tcgetattr();
#endif
}
EOF
if eval $compile; then
tcgetattr=1
fi
rm -f conftest*
#endif
echo checking for tcsetattr
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_tcsetattr
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char tcsetattr(); tcsetattr();
#endif
}
EOF
if eval $compile; then
tcsetattr=1
fi
rm -f conftest*
#endif
if test $tcgetattr -a $tcsetattr ; then
DEFS="$DEFS -DPOSIX=1"
SEDDEFS="${SEDDEFS}\${SEDdA}POSIX\${SEDdB}POSIX\${SEDdC}1\${SEDdD}
\${SEDuA}POSIX\${SEDuB}POSIX\${SEDuC}1\${SEDuD}
\${SEDeA}POSIX\${SEDeB}POSIX\${SEDeC}1\${SEDeD}
"
fi
# first check for the pure bsd
echo checking for struct sgttyb
cat > conftest.c <<EOF
#include <sgtty.h>
main()
{
struct sgttyb tmp;
exit(0);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
DEFS="$DEFS -DHAVE_SGTTYB=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SGTTYB\${SEDdB}HAVE_SGTTYB\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SGTTYB\${SEDuB}HAVE_SGTTYB\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SGTTYB\${SEDeB}HAVE_SGTTYB\${SEDeC}1\${SEDeD}
" PTY_TYPE=sgttyb
fi
rm -f conftest*
# next check for the older style ttys
echo checking for struct termio
cat > conftest.c <<EOF
#include <termio.h>
main()
{
struct termio tmp;
exit(0);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
DEFS="$DEFS -DHAVE_TERMIO=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TERMIO\${SEDdB}HAVE_TERMIO\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_TERMIO\${SEDuB}HAVE_TERMIO\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_TERMIO\${SEDeB}HAVE_TERMIO\${SEDeC}1\${SEDeD}
" PTY_TYPE=termio
fi
rm -f conftest*
# now check for the new style ttys (not yet posix)
echo checking for struct termios
cat > conftest.c <<EOF
#include <termios.h>
main()
{
struct termios tmp;
exit(0);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
DEFS="$DEFS -DHAVE_TERMIOS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TERMIOS\${SEDdB}HAVE_TERMIOS\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_TERMIOS\${SEDuB}HAVE_TERMIOS\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_TERMIOS\${SEDeB}HAVE_TERMIOS\${SEDeC}1\${SEDeD}
" PTY_TYPE=termios
fi
rm -f conftest*
# finally check for Cray style ttys
echo checking for Cray-style ptys
SETUID="@:"
cat > conftest.c <<EOF
main(){
#ifdef CRAY
return 0;
#else
return 1;
#endif
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
PTY_TYPE=unicos SETUID="chmod u+s"
fi
rm -f conftest*
#
# Check for select and/or poll. If both exist, we prefer select.
# if neither exists, define SIMPLE_EVENT.
#
select=0
poll=0
echo checking for select
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_select
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char select(); select();
#endif
}
EOF
if eval $compile; then
select=1
fi
rm -f conftest*
#endif
echo checking for poll
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_poll
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char poll(); poll();
#endif
}
EOF
if eval $compile; then
poll=1
fi
rm -f conftest*
#endif
if test $poll -a $select ; then
EVENT_TYPE=select
poll=0
elif test $poll ; then
EVENT_TYPE=poll
elif test $select ; then
EVENT_TYPE=select
else
DEFS="$DEFS -DSIMPLE_EVENT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}SIMPLE_EVENT\${SEDdB}SIMPLE_EVENT\${SEDdC}1\${SEDdD}
\${SEDuA}SIMPLE_EVENT\${SEDuB}SIMPLE_EVENT\${SEDuC}1\${SEDuD}
\${SEDeA}SIMPLE_EVENT\${SEDeB}SIMPLE_EVENT\${SEDeC}1\${SEDeD}
"
fi
#
for func in getpty
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_${func}
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char ${func}(); ${func}();
#endif
}
EOF
if eval $compile; then
DEFS="$DEFS -D${trfunc}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
done
for func in _getpty
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); }
t() {
#ifdef __stub_${func}
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char ${func}(); ${func}();
#endif
}
EOF
if eval $compile; then
DEFS="$DEFS -D${trfunc}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif
done
# SETUID="@:"
#
# Set up makefile substitutions
#
if test -n "$prefix"; then
test -z "$exec_prefix" && exec_prefix='${prefix}'
prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
prsub="$prsub
s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
exec_prefix\\1=\\2$exec_prefix%"
fi
trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null`:
#
# $0 $*
for arg
do
case "\$arg" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
exec /bin/sh $0 $* ;;
*) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
esac
done
trap 'rm -f Makefile exp_conf.h conftest*; exit 1' 1 3 15
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
RANLIB='$RANLIB'
CPP='$CPP'
PTY_TYPE='$PTY_TYPE'
EVENT_TYPE='$EVENT_TYPE'
SETUID='$SETUID'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
EOF
cat >> config.status <<\EOF
top_srcdir=$srcdir
for file in .. Makefile; do if [ "x$file" != "x.." ]; then
srcdir=$top_srcdir
# Remove last slash and all that follows it. Not all systems have dirname.
dir=`echo $file|sed 's%/[^/][^/]*$%%'`
if test "$dir" != "$file"; then
test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
test ! -d $dir && mkdir $dir
fi
echo creating $file
rm -f $file
echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
sed -e "
$prsub
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@PTY_TYPE@%$PTY_TYPE%g
s%@EVENT_TYPE@%$EVENT_TYPE%g
s%@SETUID@%$SETUID%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
fi; done
echo creating exp_conf.h
# These sed commands are put into SEDDEFS when defining a macro.
# They are broken into pieces to make the sed script easier to manage.
# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
# is the cpp macro being defined and VALUE is the value it is being given.
# Each defining turns into a single global substitution command.
#
# SEDd sets the value in "#define NAME VALUE" lines.
SEDdA='s@^\([ ]*\)#\([ ]*define[ ][ ]*\)'
SEDdB='\([ ][ ]*\)[^ ]*@\1#\2'
SEDdC='\3'
SEDdD='@g'
# SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
SEDuA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
SEDuB='\([ ]\)@\1#\2define\3'
SEDuC=' '
SEDuD='\4@g'
# SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
SEDeA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
SEDeB='$@\1#\2define\3'
SEDeC=' '
SEDeD='@g'
rm -f conftest.sed
cat > conftest.sed <<CONFEOF
EOF
# Turn off quoting long enough to insert the sed commands.
cat >> config.status <<EOF
$SEDDEFS
EOF
cat >> config.status <<\EOF
CONFEOF
rm -f conftest.h
# Break up the sed commands because old seds have small limits.
cp $top_srcdir/exp_conf.h.in conftest.h1
while :
do
lines=`grep -c . conftest.sed`
if test -z "$lines" || test "$lines" -eq 0; then break; fi
rm -f conftest.s1 conftest.s2 conftest.h2
sed 40q conftest.sed > conftest.s1 # Like head -40.
sed 1,40d conftest.sed > conftest.s2 # Like tail +41.
sed -f conftest.s1 < conftest.h1 > conftest.h2
rm -f conftest.s1 conftest.h1 conftest.sed
mv conftest.h2 conftest.h1
mv conftest.s2 conftest.sed
done
rm -f conftest.sed conftest.h
echo "/* exp_conf.h. Generated automatically by configure. */" > conftest.h
cat conftest.h1 >> conftest.h
rm -f conftest.h1
if cmp -s exp_conf.h conftest.h 2>/dev/null; then
# The file exists and we would not be changing it.
rm -f conftest.h
else
rm -f exp_conf.h
mv conftest.h exp_conf.h
fi
EOF
chmod +x config.status
test -n "$no_create" || ./config.status